package com.lpf.www.dao;

import com.lpf.www.common.entity.User;
import com.lpf.www.common.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * @Author lpf
 * @Date 2022/1/2 下午9:33
 * @ProjectName live-streaming-os
 * @Version 1.0
 * @Description:
 */
@Repository
public class UserDao {

    private UserMapper userMapper;

    @Autowired
    public void setUserMapper(UserMapper userMapper){
        this.userMapper = userMapper;
    }

    public User selectUserByUsername(String username) {
        return userMapper.selectUserByUsername(username);
    }

    public int insertUser(User user) {
        return userMapper.insert(user);
    }

    public User selectUserByPhone(String phone) {
        return userMapper.selectUserByPhone(phone);
    }

    public User selectUserByEmail(String email) {
        return userMapper.selectUserByEmail(email);
    }
}
